package com.cqb.cn.mapper;

import com.cqb.cn.modle.bo.Teacher;
import com.cqb.cn.modle.vo.PersonVo;
import com.cqb.cn.modle.po.Course;
import com.cqb.cn.modle.po.Person;
import com.cqb.cn.modle.vo.Student;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @project_name: hqbz
 * @package_name: com.htsy.hqbz.mapper
 * @ClassName: PersonCoverBasic
 * @description: TODO
 * Author by cqb, Date on 2020/9/30，21:06
 * PS: Not easy to write code, please indicate.
 */
@Mapper
public interface PersonCoverBasic {
    PersonCoverBasic INSTANCE= Mappers.getMapper(PersonCoverBasic.class);
    //属性名称不一样
    @Mapping(source = "name", target = "stuname")
    Student toCoverVo(Person source);
    //属性类型不一样
    PersonVo toPersonCoverVo(Person source);
    List<PersonVo> toConvertVos(List<Person> source);
    //合并2个po到bo
    Teacher toUnionPersonAndCourse(Person person, Course course);






}
